<extend name="Public/base"/>

<block name="nav">

    <ul class="nav nav-tabs" >


        <volist name="buildings" id="v">

            <li
            <if condition="$v[id] eq $building_id && ACTION_NAME eq 'index'"> class="active"</if>
            ><a href="{:U('index',array('building_id'=>$v['id']))}">{$v.name}</a></li>
        </volist>


        <if condition="check_url(MODULE_NAME . '/' . CONTROLLER_NAME . '/today_checkout',UID)">
        <li><a href="{:U('today_checkout')}">今日退房


                <span class="badge badge-danger">{$today_checkout_num}</span>





        </a></li>

            </if>


        <li class="pull-right nav-tabls-plus">

            <if condition="$type eq 'status'">
            <span class="label label-success arrowed-in-right arrowed">空房</span>
            <span class="label label-warning arrowed-in-right arrowed">未满</span>
            <span class="label label-danger arrowed-in-right arrowed">满房</span>

            <else/>

            <span class="label label-danger arrowed-in-right arrowed">单间</span>
            <span class="label label-warning arrowed-in-right arrowed">标间</span>
            <span class="label label-success arrowed-in-right arrowed">套房</span>
            <span class="label label-info arrowed-in-right arrowed">值班房</span>


              </if>

        </li>


    </ul>
    <div>

    </div>

</block>





<block name="body">


    <div class="page-content tab-content" id="f_list_content">




        <div class="well am-alert-success clearfix">

            <div class="pull-left">

                <span class="mr10"> 房间数: {$sum.room}</span>
                <span class="mr10"> 入住总人数: {$sum.max_num}</span>
                <span class="mr10" > 空闲房间: {$sum.kong_room}</span>
                <span class="mr10"> 未住满房间: {$sum.weiman_room}</span>
                <span class="mr10"> 空余床位: {$sum.kong_chuang}</span>

            </div>
            <div class="pull-right">
                <form class=" form-inline " method="get" action="{:U('')}">

                    <div class="form-group">

                        <a  href='{:U("index",array("building_id"=>$building_id,"keyword"=>I("get.keyword"),"type"=>"type"))}' class="btn btn-xs btn-yellow
                          <if condition='$type eq "type"'>active</if>
                        ">
                             房型
                        </a>

                        <a  href='{:U("index",array("building_id"=>$building_id,"keyword"=>I("get.keyword"),"type"=>"status"))}' class="btn btn-xs btn-yellow
                        <if condition='$type eq "status"'>active</if>
                        ">

                            状态
                        </a>

                    </div>


                    <div class="form-group">

                        <input type="text" class="input length_2" name="keyword" style="width:200px;" value="{:I('get.keyword')}" placeholder="请输入房间号或者姓名">
                    </div>

                    <input type="hidden" name="type" value="{$type}">
                    <input type="hidden" name="building_id" value="{$building_id}">

                    <div class="form-group">
                        <button class="btn btn-xs btn-info" data-toggle="tooltip" title="搜索">
                            <i class="icon-search bigger-110"></i>


                        </button>

                        <a  data-toggle="tooltip" title="清除搜索项"  href="{:U('index',array('building_id'=>$building_id))}" class="tooltip-danger btn btn-xs btn-danger"><i class="icon-remove bigger-110"></i></a>
                    </div>

                </form>

            </div>





        </div>
        <if condition="$info">


            <volist name="info" id="v">
                <dl class="dl-horizontal f_list">
                    <dt>{$key}

                        <switch name="building_id" >
                            <case value="3">#</case>

                            <default />楼
                        </switch>
                    </dt>
                    <dd>
                        <ul class="list-inline  pricing-span-body">

                            <volist name="v" id="vo">


                                <div class="pricing-span " id="room_{$vo.id}" >

                                    <a href="{:U('room',array('room_id'=>$vo['id']))}">
                                    <div class="widget-box pricing-box-small">
                                        <div class="widget-header  text-center

                                        <if condition="$type eq 'status'">

                                           <switch name="vo.status" >
                                        <case value="1">header-color-green</case>
                                        <case value="2">header-color-orange</case>
                                        <case value="0">header-color-red</case>

                                        </switch>

                                        <else/>

                                        <switch name="vo.type" >
                                            <case value="7">header-color-red</case>
                                            <case value="8">header-color-green</case>
                                            <case value="9">header-color-orange</case>
                                            <case value="32">header-color-blue</case>

                                        </switch>

                                        </if>




                                        ">



                                            <h5 class="bigger lighter">{$vo.name}


                                                [{:str_cut(F("Var_room_type")[$vo["type"]][name],1,"")}]
                                           </h5>


                                        </div>

                                        <div class="widget-body">
                                            <div class="widget-main no-padding">
                                                <ul class="list-unstyled list-striped pricing-table users">

                                                    <li>&nbsp</li>
                                                    <li>&nbsp </li>
                                                </ul>


                                            </div>
                                        </div>
                                    </div>
                                </a>
                                </div>

                            </volist>



                        </ul>
                    </dd>
                </dl>

            </volist>

        </if>



    </div>


</block>


<block name="script">


    <script>


        $.post("{:U('Public/get_rooms',array('building_id'=>$building_id))}",{RoomNumber:$(this).data("id")},function(data){




            $.each(data, function (lou, v) {


//                alert("#room_"+ v.room_id+"_"+v.name)

                html="<li>"+v.name+"</li>";





                $("#room_"+ v.room_id+" .users li:first").before(html);
                $("#room_"+ v.room_id+" .users li:last").detach();



            })





        });

    </script>



        </block>